package com.tempjob.common.vo.admin;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * DeptRespNodeVO
 *
 * @version V1.0
 */
@Data
public class DeptNodeVO {

    @ApiModelProperty(value = "组织id")
    private Long deptId;

    @ApiModelProperty(value = "组织编码")
    private Long deptNo;

    @ApiModelProperty(value = "组织名称")
    private String deptName;

    private String label;

    @ApiModelProperty(value = "组织父级id")
    private Long deptPid;

    @ApiModelProperty(value = "组织状态")
    private Integer deptStatus;

    @ApiModelProperty(value = "")
    private Long id;

    @ApiModelProperty(value = "部门类型:1系统管理2区级系统(有市级账号)3科室及下级")
    private Integer deptType;

    @ApiModelProperty(value = "部门简称")
    private String deptShortName;


    @ApiModelProperty(value = "部门曾用名")
    private String deptUsedName;


    @ApiModelProperty(value = "上级部门编码")
    private String deptParentNo;


    @ApiModelProperty(value = " 市级系统部门编码")
    private String deptGovNo;


    @ApiModelProperty(value = "部门排序")
    private Integer deptRank;


    @ApiModelProperty(value = "办公电话")
    private String deptTel;

    @ApiModelProperty(value = "部门层级:1系统管理,2区级部门,3街道级部门,4街道下级部门")
    private Integer deptLevel;

    @ApiModelProperty(value = " 办公地址")
    private String deptAddress;

    @ApiModelProperty("回复工单自动审核:true上级已授权,false上级未授权")
    private Boolean autoReplyParent;

    @ApiModelProperty("自动回复上级true:上级已授权,false上级未授权")
    private Boolean autoAuditReply;

    @ApiModelProperty("退回自动审核true:上级已授权,false上级未授权")
    private Boolean autoReturnAudit;

    @ApiModelProperty("自动审核下级回复")
    private Boolean autoAuditLowerReply;

    @ApiModelProperty(value = "街道编码")
    private Long deptStreetNo;

    @ApiModelProperty("附件地址")
    private String deptFile;

    @ApiModelProperty("附件地址")
    private List<UploadFileVO> deptFiles;

//    public void setDeptFiles(String host) {
//        if (deptFile != null && !StringUtils.isEmpty(deptFile)) {
//            List<String> files = JSON.parseArray(deptFile, String.class);
//            List<UploadFileVO> list = new ArrayList<>();
//            files.forEach(f -> {
//                list.add(new UploadFileVO(null, f, host + f));
//            });
//            this.deptFiles = list;
//        }
//    }

    @ApiModelProperty(value = "子集")
    private List<DeptNodeVO> children;

    public void setName(String deptName) {
        this.label = deptName;
        this.deptName = deptName;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
        this.id = deptId;
    }
}
